﻿using FHJFPro.EntityFrameworkCore;
using FHJFPro.UserInfos.Repositories;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;

namespace FHJFPro.Repositories.UserInfoRepository
{
    public class UserInfoRepository : EfCoreRepository<FHJFProDbContext, UserInfo, Guid>, IUserInfoRepository
    {
        public UserInfoRepository(IDbContextProvider<FHJFProDbContext> dbContextProvider):base(dbContextProvider)
        {

        }
        public async Task<UserInfo> FindByNameAsync(string name)
        {
            var dbSet = await GetDbSetAsync();
            return await dbSet.FirstOrDefaultAsync(user => user.UserName == name);
        }
    }
}
